package cn.e3.sso.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.e3.pojo.TbUser;
import cn.e3.sso.service.RegisterCheck;
import cn.e3.utils.E3Result;


@Controller
public class RegisterController {
	@RequestMapping("/page/register")
	
	public String loginPage(){
		return "register";
	}
	@Autowired
	private RegisterCheck registerCheck;
	@RequestMapping("/user/check/{param}/{type}")
	@ResponseBody
	public E3Result registerCheck(@PathVariable String param,@PathVariable
			
			Integer type){
		E3Result result = registerCheck.registerCheck(param, type);
		return result;
	}
	/*
	 * 用户登录
	 */
	@RequestMapping(value="/user/register",method=RequestMethod.POST)
	@ResponseBody
	public E3Result register(TbUser user){
		E3Result e3Result = registerCheck.register(user);
		return e3Result;
	}
}
